package com.xmb.wechat.entity;

import android.content.Context;

import com.blankj.utilcode.util.Utils;
import com.nil.sdk.utils.ACache;
import com.xmb.wechat.R;

import java.io.Serializable;

/**
 * 我的微信信息：微信名、微信号。。。
 */
public class WechatAppInfoBean implements Serializable {
    private String name;//微信名
    private String wechat_id;//微信号
    private String avatar;//头像
    private String chatCommonBG;//通用聊天背景
    private String lingqian         = "0.00";//零钱
    private String lingqiantong     = "0.00";//wechat_lingqiantong
    private String lingqiantongRate = "3.17";//零钱通收益率

    public WechatAppInfoBean(String name, String wechat_id) {
        this.name = name;
        this.wechat_id = wechat_id;
    }

    public static WechatAppInfoBean getWechat(Context ctx) {
        WechatAppInfoBean vo = (WechatAppInfoBean) ACache.get(ctx).getAsObject("WechatAppInfoBean");
        if (vo == null)
            vo = new WechatAppInfoBean(Utils.getApp().getString(R.string.wechat_default_my_name), Utils.getApp().getString(R.string.wechat_default_my_id));
        return vo;
    }

    public static WechatAppInfoBean getAliPay(Context ctx) {
        WechatAppInfoBean vo = (WechatAppInfoBean) ACache.get(ctx).getAsObject("AliPayAppInfoBean");
        if (vo == null)
            vo = new WechatAppInfoBean(Utils.getApp().getString(R.string.alipay_default_my_name), Utils.getApp().getString(R.string.alipay_default_my_id));
        return vo;
    }

    public static WechatAppInfoBean getQQ(Context ctx) {
        WechatAppInfoBean vo = (WechatAppInfoBean) ACache.get(ctx).getAsObject("QQAppInfoBean");
        if (vo == null)
            vo = new WechatAppInfoBean(Utils.getApp().getString(R.string.qq_default_my_name), Utils.getApp().getString(R.string.qq_default_my_id));
        return vo;
    }

    public static void putOrUptate(Context ctx, WechatAppInfoBean wechatAppInfoBean) {
        ACache.get(ctx).put("WechatAppInfoBean", wechatAppInfoBean);
    }

    public String getLingqian() {
        return lingqian;
    }

    public void setLingqian(String lingqian) {
        this.lingqian = lingqian;
    }

    public String getLingqiantong() {
        return lingqiantong;
    }

    public void setLingqiantong(String lingqiantong) {
        this.lingqiantong = lingqiantong;
    }

    public String getLingqiantongRate() {
        return lingqiantongRate;
    }

    public void setLingqiantongRate(String lingqiantongRate) {
        this.lingqiantongRate = lingqiantongRate;
    }

    public String getChatCommonBG() {
        return chatCommonBG;
    }

    public void setChatCommonBG(String chatCommonBG) {
        this.chatCommonBG = chatCommonBG;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWechat_id() {
        return wechat_id;
    }

    public void setWechat_id(String wechat_id) {
        this.wechat_id = wechat_id;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
}
